import { createRouter, createWebHistory } from 'vue-router'
// 引入也级页面路由
import HomeRouter from '../views/home/router.js'
// 引入二级页面路由
import secondRouter from '../views/secondPage/router.js'
// console.log(...HomeRouter);
const routes = [
    {
        path:'/',
        redirect:'/home'
    },
   ...secondRouter, 
  
  {
    path: '/index',
    name: 'index',
    component: () => import(/* webpackChunkName: "about" */ '../views/Index.vue'),
    children:[
        ...HomeRouter
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
